@use "sass:map";

@import "./musicbrainz-entity-icons";

$outer-padding: $grid-gutter-width * 0.5;

#metadata-viewer {
  padding: 0.25em;

  // In smaller screen sizes, wrap content on two lines
  display: block;
  > * {
    width: auto;
    margin: 0;
    max-width: 100%;
  }

  .no-listen {
    height: 100%;
    font-size: $font-size-lg;
    padding: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    .pause-icon {
      margin-top: -2.1em;
      background-color: white;
      display: block;
      width: max-content;
      margin-left: auto;
      margin-right: auto;
    }
  }

  @media (min-width: map.get($grid-breakpoints, "sm")) {
    // In bigger screen sizes, use flexbox
    display: flex;
    flex-wrap: wrap;

    div.left-side {
      margin-right: $outer-padding;
      resize: horizontal;
      overflow: auto;
      min-width: 340px;
      max-width: 50%;
      margin-bottom: 0;
    }
    .right-side {
      flex: 1;
    }
  }

  .left-side {
    resize: none;
    padding: $outer-padding;
    background-color: fadein($black, 30%);
    transition: background-color 0.3s;
    border-radius: $border-radius;
    margin-bottom: $outer-padding;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .track-info a,
    .bottom > a {
      color: inherit;
      &:visited {
        color: inherit;
      }
    }
    .album-art {
      height: 100%;
      display: flex;
      justify-content: space-around;
      max-height: calc(100vh - 130px);
      img {
        flex: 1;
        max-width: 100%;
        object-fit: cover;
        object-position: center;
      }
    }
    .track-info {
      display: flex;
      padding: $outer-padding 0;
      .track-name {
        font-size: 1.4em;
        line-height: 1em;
      }
      .artist-name {
        opacity: 0.85;
      }
      > *:first-child {
        flex: 3;
      }
    }
    .love-hate {
      display: flex;
      justify-content: space-between;
      font-size: 0.9em;
      align-items: start;
      .love {
        stroke: $love;
        color: transparent;
        stroke-width: 1.3em;
        &:hover,
        &.loved {
          stroke: transparent;
          color: $love;
        }
      }

      .hate {
        stroke: $hate;
        color: transparent;
        stroke-width: 1.3em;
        &:hover,
        &.hated {
          stroke: transparent;
          color: $hate;
        }
      }
    }
    .bottom {
      display: flex;
      align-items: center;
      padding-top: $outer-padding;
      .logo {
        height: 1.5em;
      }
      .support-artist-btn {
        margin-left: auto;
        .caret {
          margin-left: 1em;
        }
      }
    }
  }
  .right-side {
    display: flex;
    flex-direction: column;
    overflow: auto;
    margin-bottom: 0;

    .content-box {
      padding: 0.4em;
      border-radius: $border-radius;
      box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1) inset;
      background-color: $body-tertiary-bg;
      min-height: 2.8em; // adapt to add-tag component height
      align-items: center;

      &.white {
        background-color: white;
      }
      & + .content-box {
        margin-top: $outer-padding;
      }
    }

    #accordion {
      .accordion-item {
        transition: flex 0.5s ease-in-out;
      }
      .accordion-collapse.collapse.show {
        // Making full-height flex accordion
        flex: 1;
        // display: flex;
      }
      .accordion-header {
        margin: 0;
      }

      .credits-table {
        line-height: 2em;
        margin: 0;
        > tbody > tr:first-of-type > td {
          border-top: none;
        }
        tr td + td {
          text-align: right;
        }
      }
    }
  }
}
